#include "doctor.h"

Doctor::Doctor(QObject *parent) : QObject(parent)
{

}

Doctor::Doctor(const Doctor &info): QObject( nullptr ),
    m_id(info.m_id),
    m_name(info.m_name),
    m_age(info.m_age),
    m_sex(info.m_sex),
    m_phone(info.m_phone),
    m_work_age(info.m_work_age),
    m_major(info.m_major),
    m_attendence(info.m_attendence),
    m_status(info.m_status)
{

}

Doctor::Doctor(int id, QString name, int age, QString sex, float w_age, QString major, int attendence, int status, QString phone)
{
        this->m_id = id;
        this->m_name = name;
        this->m_age = age;
        this->m_sex = sex;
        this->m_phone = phone;
        this->m_work_age = w_age;
        this->m_major = major;
        this->m_attendence = attendence;
        this->m_status = status;
}

QStringList Doctor::getInfo()
{
    QStringList info;
    info.push_back(QString::number(this->m_id));
    info.push_back(this->m_name);
    info.push_back(QString::number(this->m_age));
    info.push_back(this->m_sex);
    info.push_back(QString("%1").arg(this->m_work_age));
    info.push_back(this->m_major);
    if (this->m_attendence == 1) {
       info.push_back("是");
    }
    else
    {
        info.push_back("否");
    }
    if (this->m_status == 1) {
       info.push_back("是");
    }
    else
    {
        info.push_back("否");
    }
    info.push_back(this->m_phone);

    return info;
}

Doctor Doctor::operator=(const Doctor &info)
{
    Doctor doc(info);
    return doc;
}


